package com.yuexinduo.education.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.yuexinduo.education.R;
import com.yuexinduo.baselibrary.base.BaseListAdapter;
import com.yuexinduo.education.bean.HomeSchoolBean;

import java.util.List;

public class HomeSchoolAdapter extends BaseListAdapter<HomeSchoolBean> {
    private Context mContext;
    public HomeSchoolAdapter(Context context, List<HomeSchoolBean> list) {
        super(context, list);
        this.mContext=context;
    }

    @Override
    public View initView(HomeSchoolBean homeSchoolBean, View convertView, ViewGroup parent, int pos) {
        ViewHolder mViewHolder;
        if (convertView == null){
            convertView = LayoutInflater.from(mContext).inflate(R.layout.item_home_school,parent,false);
            mViewHolder = new ViewHolder();
            mViewHolder.itemSchool = (TextView) convertView.findViewById(R.id.item_home_school);
            convertView.setTag(mViewHolder);

        }else {
            mViewHolder = (ViewHolder) convertView.getTag();
        }
        mViewHolder.itemSchool.setText(homeSchoolBean.getName());
        return convertView;
    }
    class ViewHolder{
        private TextView itemSchool;


    }
}
